#include <cstdio>
#include <cstdlib>
#include <ctime>

using namespace std;

void data() {
    FILE *in = fopen("village.in", "w");
    int n=5, m=5;
    fprintf(in, "%d %d\n", n, m);
    for (int i=1; i<=n; i++) {
        for (int j=1; j<=m; j++) {
            fprintf(in, "%d", rand()%2);
        }
        fprintf(in, "\n");
    }
    fclose(in);
}

int main() {
    srand(time(0));
    for (; ; ) {
        data();
        if (system("./bin")) {
            printf("Re!\n");
            return -1;
        } else if (system("./checker")) {
            printf("Ce!\n");
            return -1;
        } else if (system("cmp village.out checker.out")) {
            printf("Wa\n");
            return -1;
        }
    }
    return 0;
}
